package com.settlement.system.service.impl;

import com.settlement.system.mapper.TblRpaBankCardMapper;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.TblRpaBankCard;
import com.settlement.system.service.ITblRpaBankCardService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import com.settlement.system.mapper.BaseMapper;
import jakarta.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * RPA3.0专项费用充值-银行卡信息表 服务实现类
 * @author xiaochuan
 * @since 2021-03-09
 */
@Slf4j
@Service
public class TblRpaBankCardServiceImpl extends BaseServiceImpl implements ITblRpaBankCardService {

    @Resource
    private TblRpaBankCardMapper tblRpaBankCardMapper;

    @Override
    public BaseMapper init() {
        return tblRpaBankCardMapper;
    }

    @Override
    public TblRpaBankCard getFoot(Map<String, Object> params) throws ServiceException {
        try {
            return tblRpaBankCardMapper.getFoot(params);
        } catch (Exception ex) {
            log.error("获取合计异常", ex);
            throw new ServiceException("获取合计异常", ex);
        }
    }

    @Override
    public List<String> getCardNosByCardNos(@Param("cardNos") String cardNos) throws ServiceException {
        try {
            return tblRpaBankCardMapper.getCardNosByCardNos(cardNos);
        } catch (Exception ex){
            log.error("Get TblAdvertiseMarketAccount by ncShopNo happen exception",ex);
            throw new ServiceException("Get TblAdvertiseMarketAccount by ncShopNo happen exception",ex);
        }
    }

}

